package com.bw.task;

import com.bw.service.ChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author bobo棒
 * @date 2024年07月09日 11:00
 */

@Configuration
public class TaskPublish {
    @Autowired
    ChannelService channelService;

    /**
     * 每价格1分钟扫描数据库 执行发布
     */
    @Scheduled(fixedDelay = 1000 * 60)
    public void taskPublish(){
      int i =  channelService.publish();
      System.out.println("发布成功"+i);
    }
}
